[https://nvbugs/6411931][fix] Append ,fo to the ignore-words-list in pyproject.toml…#15924
[https://nvbugs/6411931][fix] Append ,fo to the ignore-words-list in pyproject.toml…#15924trtllm-agent wants to merge 1 commit into
,fo to the ignore-words-list in pyproject.toml…#15924Conversation
…ignore list The Release-Check codespell hook flagged triton_backend/all_models/whisper/whisper_bls/1/tokenizer.py:101 — '"fo": "faroese",' — as a typo (fo -> of/for/to/do/go). This is a false positive: 'fo' is the ISO-639-1 language code for Faroese in OpenAI Whisper's vendored LANGUAGES dict. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
📝 WalkthroughWalkthroughUpdates the ChangesCodespell Configuration Update
Estimated code review effort: 1 (Trivial) | ~2 minutes Estimated code review effortEstimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pyproject.toml`:
- Line 22: The new `fo` exception is only added in `pyproject.toml`, but the
codespell pre-commit setup still uses its own hard-coded ignore list, so the CI
hook will keep flagging it. Update the codespell configuration in
`.pre-commit-config.yaml` to include `fo` in the `-L` list, keeping it aligned
with the `ignore-words-list` entry in `pyproject.toml`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 82b21c56-c13a-439a-97bb-19e5ae0b081f
📒 Files selected for processing (1)
pyproject.toml
| [tool.codespell] | ||
| skip = ".git,3rdparty,triton_kernels,tests/integration/test_input_files**,**.jsonl,**.json" | ||
| ignore-words-list = "rouge,inout,atleast,strat,nd,subtile,thrid,improbe,NotIn,te,iteract,anythin,tru,Tracin,vEw,dOut,indext,asend,medias" | ||
| ignore-words-list = "rouge,inout,atleast,strat,nd,subtile,thrid,improbe,NotIn,te,iteract,anythin,tru,Tracin,vEw,dOut,indext,asend,medias,fo" |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== pyproject.toml codespell section ==\n'
rg -n -A3 -B3 '^\[tool\.codespell\]|ignore-words-list|codespell' pyproject.toml || true
printf '\n== .pre-commit-config.yaml codespell hook ==\n'
rg -n -A8 -B3 'codespell|-\s*L|ignore-words|pyproject' .pre-commit-config.yaml || true
printf '\n== other codespell config references ==\n'
rg -n 'ignore-words-list|codespell.*pyproject|--config.*pyproject|codespell' -g '!*.git' .Repository: NVIDIA/TensorRT-LLM
Length of output: 2315
🌐 Web query:
codespell pyproject.toml configuration pre-commit --ignore-words-list command line -L does codespell read pyproject automatically
💡 Result:
Yes, codespell automatically detects and reads a pyproject.toml file if it is located in the current working directory [1][2]. Configuration To use pyproject.toml, place your settings under the [tool.codespell] section [1][2]. For the ignore-words-list option, specify a comma-separated string of words [3]. For example: [tool.codespell] ignore-words-list = "word1,word2,word3" Prerequisites For this functionality to work, the tomli library must be available [1][2]. - Python 3.11 and later includes tomli support in the standard library, so no extra setup is required [4]. - For Python versions prior to 3.11, you must install the tomli package [1][2]. Pre-commit When using codespell with pre-commit, you must ensure that tomli is available to the hook's environment [4]. You can do this by adding it to the additional_dependencies list in your.pre-commit-config.yaml [3][4]: - repo: https://github.com/codespell-project/codespell rev: v2.4.2 hooks: - id: codespell additional_dependencies: - tomli If your configuration is not being picked up, confirm that the file is in the root directory (where the codespell command is executed) or specify the path explicitly using the --toml command-line argument [1][2]. Note that command-line arguments will override settings found in configuration files [1][2].
Citations:
- 1: https://github.com/codespell-project/codespell/blob/main/README.rst
- 2: https://pypi.org/project/codespell/2.4.2/
- 3: Docs request: how to put
check-filenamesandignore-words-listintopyproject.tomlcodespell-project/codespell#2839 - 4: [tool.codespell] ignore-words-list ignored in Python 3.9 and 3.10 codespell-project/codespell#3684
🌐 Web query:
codespell command line -L overrides pyproject ignore-words-list precedence merge behavior
💡 Result:
When using codespell, options provided via the command line, including the -L (or --ignore-words-list) flag, override any corresponding settings defined in a pyproject.toml configuration file [1][2][3]. Codespell does not merge the ignore-words-list from the command line with those defined in your configuration file; instead, the command line argument completely replaces the configuration file's value [1][4]. If you specify -L on the command line, only the words provided in that argument will be ignored by codespell during that execution, effectively ignoring any additional words you may have configured in pyproject.toml [1][4]. To ensure both sets of words are ignored, you must manually include all desired words in the command line argument, or rely solely on a configuration file if you prefer a persistent, unified list [1][3]. Configuration files are read in a specific order (with pyproject.toml typically checked first), and while multiple config files can be processed, command line arguments act as the final authority that overrides all config-based settings [1][4].
Citations:
- 1: https://github.com/codespell-project/codespell/
- 2: https://pypi.org/project/codespell/2.4.2/
- 3: https://github.com/codespell-project/codespell/blob/main/README.rst
- 4: https://github.com/codespell-project/codespell/blob/master/codespell_lib/_codespell.py
🌐 Web query:
codespell -L ignore words list with pyproject.toml precedence documentation
💡 Result:
To configure codespell with an ignore words list in a pyproject.toml file, use the [tool.codespell] section with the ignore-words-list key [1][2]. The value must be a string containing a comma-separated list of words [3][4]. Example configuration: [tool.codespell] ignore-words-list = "word1,word2,word3" Regarding precedence and configuration: 1. Precedence: Options specified on the command line override those defined in configuration files [1][2][5]. If multiple configuration files are present, they are read in a specific order, and the most recently read file overwrites previously specified configurations [1][2]. 2. Configuration Order: Codespell checks for configuration files in the following order [1][5]: - pyproject.toml (requires the tomli package for Python versions prior to 3.11) [1][6] - setup.cfg -.codespellrc - Any additional file explicitly supplied via the --config command line argument [1][5]. 3. Implementation Note: Because codespell maps configuration file entries to command line arguments, ensure your ignore words are lowercase if they are meant to match lowercase dictionary entries [3][4]. For boolean flags in pyproject.toml (e.g., check-hidden), setting the value to an empty string (e.g., check-hidden = "") is often the standard way to toggle them on [3][7].
Citations:
- 1: https://github.com/codespell-project/codespell/
- 2: https://github.com/codespell-project/codespell/blob/main/README.rst
- 3: Docs request: how to put
check-filenamesandignore-words-listintopyproject.tomlcodespell-project/codespell#2839 - 4: codespell complains about its
ignore-words-listin pyproject.toml codespell-project/codespell#3248 - 5: https://github.com/codespell-project/codespell?featured_on=pythonbytes
- 6: [tool.codespell] ignore-words-list ignored in Python 3.9 and 3.10 codespell-project/codespell#3684
- 7: Config file undocumented? codespell-project/codespell#3208
🌐 Web query:
codespell README -L option pyproject.toml ignore-words-list precedence combine
💡 Result:
In codespell, the ignore-words-list option is used to define a comma-separated list of words to be ignored [1][2][3]. When configuring this via pyproject.toml, you must provide the list as a string within the [tool.codespell] section [1][4][5]. Configuration Example: [tool.codespell] ignore-words-list = "word1,word2,word3" Regarding precedence and usage: 1. Precedence: Options specified directly on the command line will always override options defined in configuration files (such as pyproject.toml, setup.cfg, or .codespellrc) [4][5][3]. 2. Case Sensitivity: The ignore-words-list is case-sensitive and must match the word exactly as it appears in the codespell dictionary file [1][6]. If a word is not being ignored as expected, ensure it is written in lowercase (or the exact casing required by the dictionary) [1][6][7]. 3. Configuration Files: Codespell reads multiple configuration files if present, with the most recently read file overwriting previous settings [4][5][3]. The standard search order for configuration files includes pyproject.toml, setup.cfg, and .codespellrc [4][5]. For command-line usage, the -L flag is equivalent to --ignore-words-list [2][3][8]. If you need to ignore many words, using a separate file with the -I (or --ignore-words) option may be preferable [4][5][3].
Citations:
- 1: Docs request: how to put
check-filenamesandignore-words-listintopyproject.tomlcodespell-project/codespell#2839 - 2: https://manpages.debian.org/bookworm/codespell/codespell.1.en.html
- 3: https://github.com/codespell-project/codespell?tab=readme-ov-file
- 4: https://github.com/codespell-project/codespell/blob/main/README.rst
- 5: https://pypi.org/project/codespell/2.4.2/
- 6: Bug?
ignore-words-listseems to have no effect codespell-project/codespell#2375 - 7: I can't get ignore-words to work codespell-project/codespell#3346
- 8: README: add --ignore-words-list codespell-project/codespell#2040
Add fo to the codespell hook too. .pre-commit-config.yaml hard-codes its own -L list, so the new pyproject.toml entry is ignored by pre-commit/CI.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pyproject.toml` at line 22, The new `fo` exception is only added in
`pyproject.toml`, but the codespell pre-commit setup still uses its own
hard-coded ignore list, so the CI hook will keep flagging it. Update the
codespell configuration in `.pre-commit-config.yaml` to include `fo` in the `-L`
list, keeping it aligned with the `ignore-words-list` entry in `pyproject.toml`.
Summary
"fo"(Faroese ISO-639-1 code) in vendored Whisper LANGUAGES dict as typo suggesting of/for/to/do/go.,foto theignore-words-listinpyproject.toml[tool.codespell], matching the pattern used for other short-token exemptions (nd,te,tru, …); auto-picked-up by both the pre-commit hook and manual codespell.Test plan
Links
Summary by CodeRabbit